#!/usr/bin/perl
#
# name: db_converter.pl
# desc: converts a meterserv 1.2 database to a meterserv_1.3 database.
#       the difference is that dates are stored as sql datetime structures
#       in 1.3, but were seconds in 1.2.
#
use DBI;

my $config = {'db_user' => 'brain',
	      'db_pw' => 'brainpasswd',
	      'dsn' => 'DBI:SQLite:dbname=meters.db.example'
	      };

my $dbh = DBI->connect($config->{dsn},$config->{db_user},$config->{db_pw});

my $query = "alter table readings rename to readings_old";
my $sth = $dbh->prepare($query);
$sth->execute();

# Note - this should do something now!!!!




